#ifndef _UIOBJECT_
#define _UIOBJECT_

#include "Object.h"

#include "..\Graphic\Graphic.h"
#include "Shape.h"

#include <string>

using namespace std;

namespace air {

	class UIObject: public IObject{
	public:
		UIObject()
			: lastMouseInObj(false), nextMouseInObj(false), pace(false) 
		{
		}
		bool lastMouseInObject(bool _pace) {
			if (_pace != pace) {
				lastMouseInObj = nextMouseInObj;
				_pace = pace;
			}
			return lastMouseInObj;
		}
		void setMouseIn(bool _pace) {
			if (_pace != pace) {
				lastMouseInObj = nextMouseInObj;
				pace = _pace;
			}
			nextMouseInObj = true;
		}
		void setMouseOut(bool _pace) {
			if (pace != _pace) {
				lastMouseInObj = nextMouseInObj;
				pace = _pace;
			}
			nextMouseInObj = false;
		}
		virtual bool isPointInObject(float x, float y) {
			return getShape()->isPointInShape(x, y);
		}
		virtual Shape* getShape() = 0;
		virtual ~UIObject() {
		}
	private:
		bool lastMouseInObj;
		bool nextMouseInObj;
		bool pace;
	};

	
}
 
#endif